package com.cloudpolice.equipment.dao;

import com.cloudpolice.equipment.model.EquipmentModel;
import com.cloudpolice.equipment.model.EquipmentSiteModel;
import com.cloudpolice.equipment.model.InPutParam.EquipmentSelectInParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ：梁昊，后端工程师：flyman5，前端工程师：孙耀
 * @create 2020-02-29 17:13
 * @function
 * @editLog
 */
@Mapper
public interface EquipmentMapper {
    /**
     * 新增设备基本信息
     *
     * @param equipmentModel equipment.model.InPutParam.EquipmentModel
     * @return 结果
     */
    int insertEquipment(EquipmentModel equipmentModel);

    /**
     * 新增设备基本信息
     *
     * @param equipmentModel equipment.model.InPutParam.EquipmentModel
     * @return 结果
     */
    int insertEquipmentBeforeCheck(EquipmentModel equipmentModel);

    /**
     * 修改设备基本信息
     *
     * @param equipmentModel equipment.model.InPutParam.EquipmentModel
     * @return 结果
     */
    int updateEquipment(EquipmentModel equipmentModel);

    /**
     * 根据id删除基本信息
     *
     * @param id 设备SN号
     * @return 结果
     */
    int DeleteEquipmentById(String id);

    /**
     * 根据设备SN号得到设备位置信息
     *
     * @param sn 设备sn（外键）
     * @return 设备基本信息
     */
    List<EquipmentSiteModel> SelectEquipmentSiteBySn(@Param("sn") String sn);



    /**
     * 根据设备SN号得到设备基本信息
     *
     * @param equipmentSelectInParam 输入参数
     * @return 设备基本信息
     */
    EquipmentModel SelectEquipmentBySn(EquipmentSelectInParam equipmentSelectInParam);

    /**
     * 通用查询设备基本信息
     *
     * @param equipmentSelectInParam 输入参数
     * @return 结果
     */
    List<EquipmentModel> getEquipmentAll(EquipmentSelectInParam equipmentSelectInParam);

}
